#pragma once

#include <atlstr.h>
#include <vector>
#include <map>
#include "resource.h"

typedef struct _ASM_6502_INFO
{
    CString mAsm;
    CString mOp;
    CString mAddr;
    CString mCycle;
    CString mFlag;
    CString mDesc;

    _ASM_6502_INFO(CString strAsm, CString strOp , CString strAddr, CString strCycle, CString strFlag, CString strDesc)
    {
        mAsm = strAsm;
        mOp = strOp;
        mAddr = strAddr;
        mCycle = strCycle;
        mFlag = strFlag;
        mDesc = strDesc;
    }

}ASM_6502_INFO;

INT_PTR CALLBACK DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK AboutProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK WarnProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
CString GetDlgItemText(HWND hWnd, UINT uID);
CString GetWindowText(HWND hWnd);
void RefreshCode(HWND hWnd);
LRESULT CALLBACK KeyboardProc(_In_ int code, _In_ WPARAM wParam, _In_ LPARAM lParam);
void FindData();

BOOL CheckPreData(HWND hWndFocus, UINT vkCode, int nBeg, int nEnd, int nMax, int nRadix = 10);
BOOL CheckDelData(HWND hWndFocus, UINT vkCode, int nBeg, int nEnd, int nRadix = 10);

BOOL OnHexInput(HWND hWndFocus, UINT vkCode);
BOOL OnDecInput(HWND hWndFocus, UINT vkCode);
BOOL OnBinInput(HWND hWndFocus, UINT vkCode);

void UpdateHexData();
void UpdateDecData();
void UpdateBinData();

void UpdateHexText();
void UpdateDecText();
void UpdateBinText();

